Simulink Coder MIL SIL

This example shows a MIL-SIL back-to-back testing. MIL and SIL must provide the same results with the same input. C and C++ code is generated from the lights control model using Simulink Coder.

Lights control model

Open the file Help|Examples|03 Test Execution Platforms|08 Simulink Coder MIL SIL. Select Execution|Platform Configuration to open the Platform Configuration dialog. The platform configuration has already been set up.

There are 2 platform configurations - MATLAB-Platform MiL and MATLAB-Platform SiL. Both are similar while the MATLAB-Platform SiL configuration has some scripting for the code-generation and build.

Model Load Script of the 'MATLAB-Platform SIL' configuration

Select Execution|Execution Configuration to open the Execution Configuration dialog. The dialog contains the settings for the back-to-back testing.

Settings for the back-to-back testing

In the Lights Control MATLAB MiL/SiL configuration, the back-to-back testing is set up in Advanced mode and it compares the Simulink MIL execution data with the Simulink Coder SIL execution data. In the Lights Control MATLAB FUSION MiL/SiL configuration, the back-to-back testing is set up in Normal mode and it compares the FUSION execution data with the MATLAB MiL execution data, see Build a MATLAB/Simulink model for FUSION.

When comparing the data in the Signal Viewer, there may be small deviations resulting from the scaling in the FUSION Platform.

Related topics